package com.atguigu.spzx.manager.controller.order;

import com.atguigu.spzx.manager.service.order.OrderStatisticsService;
import com.atguigu.spzx.model.entity.order.OrderStatistics;
import com.atguigu.spzx.model.vo.common.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/admin/order/orderStatistics")
@Tag(name = "订单统计分析管理模块")
public class OrderStatisticsController {
    @Resource
    OrderStatisticsService orderStatisticsService;
    //begin和end需要满足格式：yyyy-MM-dd
    @Operation(summary = "查询时间区间内的统计分析数据")
    @GetMapping("list/{begin}/{end}")
    public Result list(@PathVariable("begin")String begin,
                       @PathVariable("end")String end){
        Map<String,Object> map  =  orderStatisticsService.list(begin,end);
        return Result.ok().data(map);
    }



}
